home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 4 / Apprentice-Release4.iso / Languages / Rewrite 0.2.6 / ReWrite 0.2.6 Docs / ReWrite 0.2.6 Docs.rsrc / TEXT_142.txt < prev    next >
Encoding:
Text File  |  1995-08-23  |  1.4 KB  |  40 lines

  1.  
  2. Appendix 6 - Mathematica‚Ñ¢
  3.  
  4. This section will only be of interest to those familiar with Mathematica‚Ñ¢. It compares the syntax of the two languages.
  5.  
  6. On the surface, ReWrite looks somewhat similar to Mathematica‚Ñ¢ . However there are some very important differences:
  7.  
  8. ‚Ä¢   Mathematica‚Ñ¢  is more like a functional language - it operates in a completely different way to ReWrite. It has things like fixed point evaluation, requires garbage collection etc.
  9.  
  10. ‚Ä¢  Mathematica‚Ñ¢  is interpreted whereas ReWrite is compiled - where they do operate similarly, ReWrite is much faster. This does however make Mathematica‚Ñ¢  more flexible for many applications.
  11.  
  12. ‚Ä¢  Mathematica‚Ñ¢  has a large collection of powerful functions and libraries to provide even more, whereas ReWrite is nearly minimal.
  13.  
  14.    Even given the above, there is some similarity between ReWrite and part of Mathematica‚Ñ¢ . Functions defined in Mathematica‚Ñ¢  with := can be converted to and from ReWrite in the following way:
  15.  
  16.  
  17.  
  18.  
  19.  
  20.  
  21.  
  22.  
  23.  
  24.  
  25.  
  26.  
  27.  
  28.  
  29.  
  30.  
  31.  
  32.  
  33.  
  34.  
  35.  
  36.  
  37.    Remember that although they look similar and may act similarly, the evaluation is done completely differently!
  38.    It would be easy to design a parser to convert one to the other, or indeed to use this syntax for ReWrite. However my notation suits my needs better, particularly in that my ReWrite code doesn't use token (symbols) as much as parameters, so the tokens carry the extra character ( ` ) whereas in Mathematica‚Ñ¢ the parameters do ( _ ).
  39.  
  40.